import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooWechatopenTemplateController } from '../../../controllers';
const uctoowechatopenTemplateRouter = new Router();
const wechatopenTemplateController = new uctooWechatopenTemplateController();

uctoowechatopenTemplateRouter.post('/add', requireUser, wechatopenTemplateController.add);
uctoowechatopenTemplateRouter.post('/edit', requireUser, rowLevelPermission('uctoo/wechatopen_template'), wechatopenTemplateController.edit);
uctoowechatopenTemplateRouter.post('/del', requireUser, rowLevelPermission('uctoo/wechatopen_template'), wechatopenTemplateController.delete);

//For getting wechatopenTemplate with permission control
uctoowechatopenTemplateRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/wechatopen_template'), wechatopenTemplateController.getSingle);
uctoowechatopenTemplateRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/wechatopen_template'), wechatopenTemplateController.getMany);
uctoowechatopenTemplateRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/wechatopen_template'), wechatopenTemplateController.getMany);

//#endregion AutoCreateCode
export default uctoowechatopenTemplateRouter;
